package com.wzapp.sitposture.authentication.config;

import com.wzapp.sitposture.authentication.interceptor.AuthenticationInterceptor;
import com.wzapp.sitposture.authentication.interceptor.CorsInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 拦截器配置类
 *
 * @author ql
 *
 */
@Configuration
public class InterceptorsConfiguration extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {

		registry.addInterceptor(new CorsInterceptor()).addPathPatterns("/**");
		registry.addInterceptor(new AuthenticationInterceptor()).addPathPatterns("/**");
//		registry.addInterceptor(new NeedLoginInterceptor()).addPathPatterns("/**");
		super.addInterceptors(registry);
	}

}
